"""meiduo_mall URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from . import views

urlpatterns = [
    #注册
    url(r'register/$', views.ZhuceView.as_view()),

    url(r'usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', views.UsernameCountView.as_view()),
    url(r'mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view()),
    url(r'testcode/(?P<uuidq>[\w-]+)/$',views.CodetestView.as_view()),
    #短信验证码 注册
    url(r'^sms_codes/(?P<mobile>1[3-9]\d{9})/$',views.SMSCodeView.as_view()),

    #短信验证码 登陆
    url(r'^sms_codes/(?P<username>[a-zA-Z0-9_-]{5,20})/$',views.SMSCodeView2.as_view()),

    url(r'check_sms_code/(?P<mobile>1[3-9]\d{9})/(?P<sms_code>\w{4})/$',views.CheckSmsCodeView.as_view()),

    #登陆
    url(r'^login/$', views.LoginView.as_view()),

    #退出登陆
    url(r'logout/$', views.LogoutView.as_view()),

    #用户中心
    url(r'^usercenter/$', views.UsercenterView.as_view(),name='usercenter'),

    #添加邮箱
    url(r'^email/(?P<email>[a-z0-9][\w\.\-]*@[a-z0-9\-]+(\.[a-z]{2,5}){1,2})/$', views.EmailView.as_view()),

    url(r'^checkactiveemail/$', views.CheckActiveEmailView.as_view()),

    #展示收货地址
    url(r'^address/$', views.AddressView.as_view()),

    #忘记密码
    url(r'^find/password/$', views.FindPasswordView.as_view()),

    #登陆界面发送验证码
    url(r'^login/sms_codes/(?P<mobile>1[3-9]\d{9})/$', views.LoginSMSCodeView.as_view()),

    #修改密码
    url(r'^users/(?P<username>[a-zA-Z0-9_-]{5,20})/password/$', views.ChangePasswordView.as_view()),








]
